package com.mnc.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
@Entity
public class ArticleComment implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 2043430667899958055L;
	//主键id
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int commentId;
	//评论内容
	@Column
	private String commentContent;
	//评论时间
	@Column
	private Date commentDate;
	//是否可见
	@Column
	private boolean commentView=true; 	
	//关联文章
	@ManyToOne(cascade={CascadeType.REFRESH})
	private Article onArticle;
	//评论者
	@ManyToOne(cascade={CascadeType.REFRESH})
	private User byUser;
	
	public String getCommentContent() {
		return commentContent;
	}
	public void setCommentContent(String commentContent) {
		this.commentContent = commentContent;
	}
	public Date getCommentDate() {
		return commentDate;
	}
	public void setCommentDate(Date commentDate) {
		this.commentDate = commentDate;
	}
	public Article getOnArticle() {
		return onArticle;
	}
	public void setOnArticle(Article onArticle) {
		this.onArticle = onArticle;
	}
	public User getByUser() {
		return byUser;
	}
	public void setByUser(User byUser) {
		this.byUser = byUser;
	}
	public int getCommentId() {
		return commentId;
	}
	public void setCommentId(int commentId) {
		this.commentId = commentId;
	}
	public boolean isCommentView() {
		return commentView;
	}
	public void setCommentView(boolean commentView) {
		this.commentView = commentView;
	}
	
	
}
